<?php
/**
 * Created by PhpStorm.
 * User: yellow
 * Date: 2019/5/14
 * Time: 11:47
 */

namespace app\admin\controller;

use app\admin\logic\ConfigLogic;
use think\facade\Request;

class Config extends Base{

    private $configLogic;

    public function __construct()
    {
        parent::__construct();
        $this->configLogic = new ConfigLogic();
    }

    public function index(){
        $configList = $this->configLogic->configInfo();
        $this->assign('info', $configList['data']);
        return $this->fetch();
    }

    public function handle(){
        $data = Request::post();
        $res = $this->configLogic->handle($data);
        return json($res);
    }

}